<?php

//UMA new
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schema;

class CreateNikkeisTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('nikkeis', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->date('date')->comment('日付');
            $table->double('open', 8, 1)->nullable()->comment('始値');
            $table->double('high', 8, 1)->nullable()->comment('高値');
            $table->double('low', 8, 1)->nullable()->comment('低値');
            $table->double('last', 8, 1)->nullable()->comment('終値');
            $table->double('change', 8, 1)->nullable()->comment('変化');
            $table->integer('settle')->comment('前日比');
            $table->double('volume', 8, 1)->nullable()->comment('ボリューム');
            $table->double('previous_day_open_interest', 8, 1)->nullable()->comment('前日の建玉');
            $table->integer('nikkei_rate_id')->nullable()->comment('nikkei rate id');
            $table->timestamps();
            $table->index('date');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('nikkeis');
    }
}
